/******************************************************************************* * Copyright (c) 2012, Project: FP7-ICT-257930 Aniketos * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * - Neither the name of institution nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ /** */ package org.eclipse.bpmn2.di.util; import java.util.Map; import org.eclipse.bpmn2.di.*; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.EObjectValidator; /** * <!-- begin-user-doc --> * The <b>Validator</b> for the model. * <!-- end-user-doc --> * @see org.eclipse.bpmn2.di.BpmnDiPackage * @generated */ public class BpmnDiValidator extends EObjectValidator { /** * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final BpmnDiValidator INSTANCE = new BpmnDiValidator(); /** * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see org.eclipse.emf.common.util.Diagnostic#getSource() * @see org.eclipse.emf.common.util.Diagnostic#getCode() * @generated */ public static final String DIAGNOSTIC_SOURCE = "org.eclipse.bpmn2.di"; /** * The {@link org.eclipse.emf.common.util.Diagnostic#getCode() code} for constraint 'Plane element type' of 'Plane'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final int PLANE__PLANE_ELEMENT_TYPE = 1; /** * A constant with a fixed name that can be used as the base value for additional hand written constants. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 1; /** * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT; /** * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public BpmnDiValidator() { super(); } /** * Returns the package of this validator switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EPackage getEPackage() { return BpmnDiPackage.eINSTANCE; } /** * Calls <code>validateXXX</code> for the corresponding classifier of the model. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected boolean validate(int classifierID, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) { switch (classifierID) { case BpmnDiPackage.DOCUMENT_ROOT: return validateDocumentRoot((DocumentRoot)value, diagnostics, context); case BpmnDiPackage.DIAGRAM: return validateDiagram((Diagram)value, diagnostics, context); case BpmnDiPackage.DIAGRAM_ELEMENT: return validateDiagramElement((DiagramElement)value, diagnostics, context); case BpmnDiPackage.EDGE: return validateEdge((Edge)value, diagnostics, context); case BpmnDiPackage.LABEL: return validateLabel((Label)value, diagnostics, context); case BpmnDiPackage.LABELED_EDGE: return validateLabeledEdge((LabeledEdge)value, diagnostics, context); case BpmnDiPackage.LABELED_SHAPE: return validateLabeledShape((LabeledShape)value, diagnostics, context); case BpmnDiPackage.NODE: return validateNode((Node)value, diagnostics, context); case BpmnDiPackage.PLANE: return validatePlane((Plane)value, diagnostics, context); case BpmnDiPackage.SHAPE: return validateShape((Shape)value, diagnostics, context); case BpmnDiPackage.STYLE: return validateStyle((Style)value, diagnostics, context); default: return true; } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateDocumentRoot(DocumentRoot documentRoot, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(documentRoot, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateDiagram(Diagram diagram, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(diagram, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateDiagramElement(DiagramElement diagramElement, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(diagramElement, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateEdge(Edge edge, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(edge, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateLabel(Label label, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(label, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateLabeledEdge(LabeledEdge labeledEdge, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(labeledEdge, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateLabeledShape(LabeledShape labeledShape, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(labeledShape, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateNode(Node node, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(node, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validatePlane(Plane plane, DiagnosticChain diagnostics, Map<Object, Object> context) { if (!validate_NoCircularContainment(plane, diagnostics, context)) return false; boolean result = validate_EveryMultiplicityConforms(plane, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryDataValueConforms(plane, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(plane, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(plane, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryProxyResolves(plane, diagnostics, context); if (result || diagnostics != null) result &= validate_UniqueID(plane, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryKeyUnique(plane, diagnostics, context); if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(plane, diagnostics, context); if (result || diagnostics != null) result &= validatePlane_plane_element_type(plane, diagnostics, context); return result; } /** * Validates the plane_element_type constraint of '<em>Plane</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validatePlane_plane_element_type(Plane plane, DiagnosticChain diagnostics, Map<Object, Object> context) { return plane.plane_element_type(diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateShape(Shape shape, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(shape, diagnostics, context); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateStyle(Style style, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate_EveryDefaultConstraint(style, diagnostics, context); } /** * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public ResourceLocator getResourceLocator() { // TODO // Specialize this to return a resource locator for messages specific to this validator. // Ensure that you remove @generated or mark it @generated NOT return super.getResourceLocator(); } } //BpmnDiValidator